home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
cpp_libs
/
utility.lha
/
utility
/
defs.H
next >
Wrap
C/C++ Source or Header
|
1993-08-08
|
1KB
|
47 lines
// Some common definitions.
//
// $Id: defs.H,v 1.1 91/02/21 17:59:04 dag Exp $
#ifndef DEFS_H
#define DEFS_H
typedef unsigned boolean;
static const unsigned false = 0;
static const unsigned true = 1;
#ifndef nil
#define nil 0
#endif
#ifndef NILREF
#define NILREF(type) (*(type *) &0)
#endif
#ifndef NAME2
#ifdef __DATE__
#define NAME2(a,b)a ## b
#else
#define NAME2(a,b)a/**/b
#endif
#endif
inline int min (int a, int b) { return a < b ? a : b; }
inline float min (float a, float b) { return a < b ? a : b; }
inline double min (double a, double b) { return a < b ? a : b; }
inline int max (int a, int b) { return a > b ? a : b; }
inline float max (float a, float b) { return a > b ? a : b; }
inline double max (double a, double b) { return a > b ? a : b; }
inline int round (double x) { return x > 0 ? int(x+0.5) : -int(-x+0.5); }
inline unsigned min(unsigned x, unsigned y)
{ if (x < y) return x; else return y; }
inline unsigned max(unsigned x, unsigned y)
{ if (x > y) return x; else return y; }
#endif